return AuthenticationResponse::newAbstain();
}
- $maybeLink = array_filter( $state['maybeLink'], function ( $req ) {
+ $maybeLink = array_filter( $state['maybeLink'], function ( $req ) use ( $user ) {
+ if ( !$req->action ) {
+ $req->action = AuthManager::ACTION_CHANGE;
+ }
+ $req->username = $user->getName();
return $this->manager->allowsAuthenticationDataChange( $req )->isGood();
} );
if ( !$maybeLink ) {
$this->assertCount( 1, $res->neededRequests );
$req = $res->neededRequests[0];
$this->assertInstanceOf( ConfirmLinkAuthenticationRequest::class, $req );
- $this->assertEquals( $reqs, \TestingAccessWrapper::newFromObject( $req )->linkRequests );
+ $expectReqs = $this->getLinkRequests();
+ foreach ( $expectReqs as $r ) {
+ $r->action = AuthManager::ACTION_CHANGE;
+ $r->username = $user->getName();
+ }
+ $this->assertEquals( $expectReqs, \TestingAccessWrapper::newFromObject( $req )->linkRequests );
}
public function testContinueLinkAttempt() {